home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / AIncludes / MacWindows.a < prev    next >
Encoding:
Text File  |  1998-07-17  |  58.7 KB  |  1,725 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacWindows.a
  3. ;
  4. ;    Contains:    Window Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  19. __MACWINDOWS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  25.     include 'Aliases.a'
  26.     ENDIF
  27.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  28.     include 'AppleEvents.a'
  29.     ENDIF
  30.     IF &TYPE('__COLLECTIONS__') = 'UNDEFINED' THEN
  31.     include 'Collections.a'
  32.     ENDIF
  33.     IF &TYPE('__DRAG__') = 'UNDEFINED' THEN
  34.     include 'Drag.a'
  35.     ENDIF
  36.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  37.     include 'Events.a'
  38.     ENDIF
  39.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  40.     include 'Menus.a'
  41.     ENDIF
  42.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  43.     include 'MixedMode.a'
  44.     ENDIF
  45.     IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN
  46.     include 'QDOffscreen.a'
  47.     ENDIF
  48.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  49.     include 'Quickdraw.a'
  50.     ENDIF
  51.     IF &TYPE('__TEXTCOMMON__') = 'UNDEFINED' THEN
  52.     include 'TextCommon.a'
  53.     ENDIF
  54.  
  55.     IF &TYPE('__ICONSERVICES__') = 'UNDEFINED' THEN
  56.     include 'IconServices.a'
  57.     ENDIF
  58. ; ——————————————————————————————————————————————————————————————————————————————————————
  59. ;  • Property Types                                                                        
  60. ; ——————————————————————————————————————————————————————————————————————————————————————
  61. ; typedef OSType                         PropertyCreator
  62.  
  63. ; typedef OSType                         PropertyTag
  64.  
  65. ; ——————————————————————————————————————————————————————————————————————————————————————
  66. ;  • Window Classes                                                                        
  67. ; ——————————————————————————————————————————————————————————————————————————————————————
  68. ; typedef UInt32                         WindowClass
  69.  
  70.  
  71. kAlertWindowClass                EQU        1                    ; “I need your attention now.”
  72. kMovableAlertWindowClass        EQU        2                    ; “I need your attention now, and I’m kind enough to let you switch out of this app to do other things.”
  73. kModalWindowClass                EQU        3                    ; system modal, not draggable
  74. kMovableModalWindowClass        EQU        4                    ; application modal, draggable
  75. kFloatingWindowClass            EQU        5                    ; floats above all other application windows
  76. kDocumentWindowClass            EQU        6                    ; everything else
  77.  
  78. ; ——————————————————————————————————————————————————————————————————————————————————————
  79. ;  • Window Attributes                                                                    
  80. ; ——————————————————————————————————————————————————————————————————————————————————————
  81.  
  82. ; typedef UInt32                         WindowAttributes
  83.  
  84.  
  85. kWindowNoAttributes                EQU        0                    ; no attributes
  86. kWindowCloseBoxAttribute        EQU        $00000001            ; window has a close box
  87. kWindowHorizontalZoomAttribute    EQU        $00000002            ; window has horizontal zoom box
  88. kWindowVerticalZoomAttribute    EQU        $00000004            ; window has vertical zoom box
  89. kWindowFullZoomAttribute        EQU        $00000006
  90. kWindowCollapseBoxAttribute        EQU        $00000008            ; window has a collapse box
  91. kWindowResizableAttribute        EQU        $00000010            ; window is resizable
  92. kWindowSideTitlebarAttribute    EQU        $00000020            ; window wants a titlebar on the side    (floating window class only)
  93. kWindowNoUpdatesAttribute        EQU        $00010000            ; this window receives no update events
  94. kWindowNoActivatesAttribute        EQU        $00020000            ; this window receives no activate events
  95. kWindowStandardDocumentAttributes EQU    $0000001F
  96. kWindowStandardFloatingAttributes EQU    $00000009
  97.  
  98. ; ——————————————————————————————————————————————————————————————————————————————————————
  99. ;  • Errors & Gestalt                                                                    
  100. ; ——————————————————————————————————————————————————————————————————————————————————————
  101.  
  102. gestaltWindowMgrAttr            EQU        'wind'                ; If this Gestalt exists, the PowerPC-native Window Manager is installed
  103. gestaltWindowMgrPresent            EQU        $00000001
  104.  
  105.  
  106. errInvalidWindowPtr                EQU        -5600                ; tried to pass a bad WindowPtr argument
  107. errUnsupportedWindowAttributesForClass EQU -5601            ; tried to create a window with WindowAttributes not supported by the WindowClass
  108. errWindowDoesNotHaveProxy        EQU        -5602                ; tried to do something requiring a proxy to a window which doesn’t have a proxy
  109. errInvalidWindowProperty        EQU        -5603                ; tried to access a property tag with private creator
  110. errWindowPropertyNotFound        EQU        -5604                ; tried to get a nonexistent property
  111. errUnrecognizedWindowClass        EQU        -5605                ; tried to create a window with a bad WindowClass
  112. errCorruptWindowDescription        EQU        -5606                ; tried to load a corrupt window description (size or version fields incorrect)
  113. errUserWantsToDragWindow        EQU        -5607                ; if returned from TrackWindowProxyDrag, you should call DragWindow on the window
  114. errWindowsAlreadyInitialized    EQU        -5608                ; tried to call InitFloatingWindows twice, or called InitWindows and then floating windows
  115. errFloatingWindowsNotInitialized EQU    -5609                ; called HideFloatingWindows or ShowFloatingWindows without calling InitFloatingWindows
  116. ; ——————————————————————————————————————————————————————————————————————————————————————
  117. ;  • Window Definition Type                                                                
  118. ; ——————————————————————————————————————————————————————————————————————————————————————
  119.  
  120. kWindowDefProcType                EQU        'WDEF'
  121. ; ——————————————————————————————————————————————————————————————————————————————————————
  122. ;  • System 7.5 Window Definition Resource IDs                                            
  123. ; ——————————————————————————————————————————————————————————————————————————————————————
  124.  
  125. kStandardWindowDefinition        EQU        0                    ; for document windows and dialogs
  126. kRoundWindowDefinition            EQU        1                    ; old da-style window
  127. kFloatingWindowDefinition        EQU        124                    ; for floating windows
  128. ; ——————————————————————————————————————————————————————————————————————————————————————
  129. ;  • Variant Codes                                                                        
  130. ; ——————————————————————————————————————————————————————————————————————————————————————
  131.  
  132.                                                             ; for use with kStandardWindowDefinition 
  133. kDocumentWindowVariantCode        EQU        0
  134. kModalDialogVariantCode            EQU        1
  135. kPlainDialogVariantCode            EQU        2
  136. kShadowDialogVariantCode        EQU        3
  137. kMovableModalDialogVariantCode    EQU        5
  138. kAlertVariantCode                EQU        7
  139. kMovableAlertVariantCode        EQU        9                    ; for use with kFloatingWindowDefinition 
  140. kSideFloaterVariantCode            EQU        8
  141.  
  142. ; ——————————————————————————————————————————————————————————————————————————————————————
  143. ;  • DefProc IDs                                                                        
  144. ; ——————————————————————————————————————————————————————————————————————————————————————
  145.  
  146.                                                             ; classic ids 
  147. documentProc                    EQU        0
  148. dBoxProc                        EQU        1
  149. plainDBox                        EQU        2
  150. altDBoxProc                        EQU        3
  151. noGrowDocProc                    EQU        4
  152. movableDBoxProc                    EQU        5
  153. zoomDocProc                        EQU        8
  154. zoomNoGrow                        EQU        12
  155. rDocProc                        EQU        16                    ; floating window defproc ids 
  156. floatProc                        EQU        1985
  157. floatGrowProc                    EQU        1987
  158. floatZoomProc                    EQU        1989
  159. floatZoomGrowProc                EQU        1991
  160. floatSideProc                    EQU        1993
  161. floatSideGrowProc                EQU        1995
  162. floatSideZoomProc                EQU        1997
  163. floatSideZoomGrowProc            EQU        1999
  164.  
  165.                                                             ; Resource IDs for theme-savvy window defprocs 
  166. kWindowDocumentDefProcResID        EQU        64
  167. kWindowDialogDefProcResID        EQU        65
  168. kWindowUtilityDefProcResID        EQU        66
  169. kWindowUtilitySideTitleDefProcResID EQU    67
  170.  
  171.                                                             ; Proc IDs for theme-savvy windows 
  172. kWindowDocumentProc                EQU        1024
  173. kWindowGrowDocumentProc            EQU        1025
  174. kWindowVertZoomDocumentProc        EQU        1026
  175. kWindowVertZoomGrowDocumentProc    EQU        1027
  176. kWindowHorizZoomDocumentProc    EQU        1028
  177. kWindowHorizZoomGrowDocumentProc EQU    1029
  178. kWindowFullZoomDocumentProc        EQU        1030
  179. kWindowFullZoomGrowDocumentProc    EQU        1031
  180.  
  181.                                                             ; Proc IDs for theme-savvy dialogs 
  182. kWindowPlainDialogProc            EQU        1040
  183. kWindowShadowDialogProc            EQU        1041
  184. kWindowModalDialogProc            EQU        1042
  185. kWindowMovableModalDialogProc    EQU        1043
  186. kWindowAlertProc                EQU        1044
  187. kWindowMovableAlertProc            EQU        1045
  188.  
  189.                                                             ; procIDs available in Appearance 1.0.1 or later 
  190. kWindowMovableModalGrowProc        EQU        1046
  191.  
  192.                                                             ; Proc IDs for top title bar theme-savvy floating windows 
  193. kWindowFloatProc                EQU        1057
  194. kWindowFloatGrowProc            EQU        1059
  195. kWindowFloatVertZoomProc        EQU        1061
  196. kWindowFloatVertZoomGrowProc    EQU        1063
  197. kWindowFloatHorizZoomProc        EQU        1065
  198. kWindowFloatHorizZoomGrowProc    EQU        1067
  199. kWindowFloatFullZoomProc        EQU        1069
  200. kWindowFloatFullZoomGrowProc    EQU        1071
  201.  
  202.  
  203.                                                             ; Proc IDs for side title bar theme-savvy floating windows 
  204. kWindowFloatSideProc            EQU        1073
  205. kWindowFloatSideGrowProc        EQU        1075
  206. kWindowFloatSideVertZoomProc    EQU        1077
  207. kWindowFloatSideVertZoomGrowProc EQU    1079
  208. kWindowFloatSideHorizZoomProc    EQU        1081
  209. kWindowFloatSideHorizZoomGrowProc EQU    1083
  210. kWindowFloatSideFullZoomProc    EQU        1085
  211. kWindowFloatSideFullZoomGrowProc EQU    1087
  212. ; ——————————————————————————————————————————————————————————————————————————————————————
  213. ;  • System 7 Window Positioning Constants                                                
  214. ;                                                                                         
  215. ;  Passed into StandardAlert and used in ‘WIND’, ‘DLOG’, and ‘ALRT’ templates            
  216. ;  StandardAlert uses zero to specify the default position. Other calls use zero to        
  217. ;  specify “no position”.  Do not pass these constants to RepositionWindow.  Do not        
  218. ;  store these constants in the BasicWindowDescription of a ‘wind’ resource.            
  219. ; ——————————————————————————————————————————————————————————————————————————————————————
  220.  
  221.  
  222. kWindowNoPosition                EQU        $0000
  223. kWindowDefaultPosition            EQU        $0000
  224. kWindowCenterMainScreen            EQU        $280A
  225. kWindowAlertPositionMainScreen    EQU        $300A
  226. kWindowStaggerMainScreen        EQU        $380A
  227. kWindowCenterParentWindow        EQU        $A80A
  228. kWindowAlertPositionParentWindow EQU    $B00A
  229. kWindowStaggerParentWindow        EQU        $B80A
  230. kWindowCenterParentWindowScreen    EQU        $680A
  231. kWindowAlertPositionParentWindowScreen EQU $700A
  232. kWindowStaggerParentWindowScreen EQU    $780A
  233. ; ——————————————————————————————————————————————————————————————————————————————————————
  234. ;  • Window Positioning Methods                                                            
  235. ;                                                                                         
  236. ;  Positioning methods passed to RepositionWindow.                                        
  237. ;  Do not use them in WIND, ALRT, DLOG templates.                                          
  238. ;  Do not confuse these constants with the constants above                                
  239. ; ——————————————————————————————————————————————————————————————————————————————————————
  240. ; typedef UInt32                         WindowPositionMethod
  241.  
  242.  
  243. kWindowCenterOnMainScreen        EQU        $00000001
  244. kWindowCenterOnParentWindow        EQU        $00000002
  245. kWindowCenterOnParentWindowScreen EQU    $00000003
  246. kWindowCascadeOnMainScreen        EQU        $00000004
  247. kWindowCascadeOnParentWindow    EQU        $00000005
  248. kWIndowCascadeOnParentWindowScreen EQU    $00000006
  249. kWindowAlertPositionOnMainScreen EQU    $00000007
  250. kWindowAlertPositionOnParentWindow EQU    $00000008
  251. kWindowAlertPositionOnParentWindowScreen EQU $00000009
  252. ; ——————————————————————————————————————————————————————————————————————————————————————
  253. ;  • GetWindowRegion Types                                                                
  254. ; ——————————————————————————————————————————————————————————————————————————————————————
  255.  
  256.  
  257.                                                             ; Region values to pass into GetWindowRegion 
  258. kWindowTitleBarRgn                EQU        0
  259. kWindowTitleTextRgn                EQU        1
  260. kWindowCloseBoxRgn                EQU        2
  261. kWindowZoomBoxRgn                EQU        3
  262. kWindowDragRgn                    EQU        5
  263. kWindowGrowRgn                    EQU        6
  264. kWindowCollapseBoxRgn            EQU        7
  265. kWindowStructureRgn                EQU        32
  266. kWindowContentRgn                EQU        33
  267.  
  268. kWindowTitleProxyIconRgn        EQU        8
  269. ; typedef UInt16                         WindowRegionCode
  270.  
  271. ;  GetWindowRegionRec - a pointer to this is passed in WDEF param for kWindowMsgGetRegion
  272. GetWindowRegionRec        RECORD 0
  273. winRgn                     ds.l    1                ; offset: $0 (0)
  274. regionCode                 ds.w    1                ; offset: $4 (4)
  275. sizeof                     EQU *                    ; size:   $6 (6)
  276.                         ENDR
  277. ; typedef struct GetWindowRegionRec *    GetWindowRegionPtr
  278.  
  279. ; typedef struct GetWindowRegionRec *    GetWindowRegionRecPtr
  280.  
  281. ; ——————————————————————————————————————————————————————————————————————————————————————
  282. ;  • New WDEF Message Types                                                                
  283. ; ——————————————————————————————————————————————————————————————————————————————————————
  284.  
  285. ;   SetupWindowProxyDragImageRec - setup the proxy icon drag image
  286. ;   Both regions are allocated and disposed by the Window Manager.
  287. ;   The GWorld is disposed of by the Window Manager, but the WDEF must allocate
  288. ;   it.  See Technote on Drag Manager 1.1 additions for more information and sample code for
  289. ;   setting up drag images.
  290.  
  291.  
  292.  
  293. SetupWindowProxyDragImageRec RECORD 0
  294. imageGWorld                 ds.l    1                ; offset: $0 (0)        ;  locked GWorld containing the drag image - output - can be NULL
  295. imageRgn                 ds.l    1                ; offset: $4 (4)        ;  image clip region, contains the portion of the image which gets blitted to screen - preallocated output - if imageGWorld is NULL, this is ignored
  296. outlineRgn                 ds.l    1                ; offset: $8 (8)        ;  the outline region used on shallow monitors - preallocated output - must always be non-empty
  297. sizeof                     EQU *                    ; size:   $C (12)
  298.                         ENDR
  299. ;  MeasureWindowTitleRec - a pointer to this is passed in WDEF param for kWindowMsgGetRegion
  300. MeasureWindowTitleRec    RECORD 0
  301. ;  output parameters
  302. fullTitleWidth             ds.w    1                ; offset: $0 (0)        ;  text + proxy icon width
  303. titleTextWidth             ds.w    1                ; offset: $2 (2)        ;  text width
  304. ;  input parameters
  305. isUnicodeTitle             ds.b    1                ; offset: $4 (4)
  306. unused                     ds.b    1                ; offset: $5 (5)        ;  future use
  307. sizeof                     EQU *                    ; size:   $6 (6)
  308.                         ENDR
  309. ; typedef struct MeasureWindowTitleRec * MeasureWindowTitleRecPtr
  310.  
  311. ; ——————————————————————————————————————————————————————————————————————————————————————
  312. ;  • Standard Window Kinds                                                                
  313. ; ——————————————————————————————————————————————————————————————————————————————————————
  314.  
  315. dialogKind                        EQU        2
  316. userKind                        EQU        8
  317. kDialogWindowKind                EQU        2
  318. kApplicationWindowKind            EQU        8
  319.  
  320. ; ——————————————————————————————————————————————————————————————————————————————————————
  321. ;  • FindWindow Result Codes                                                            
  322. ; ——————————————————————————————————————————————————————————————————————————————————————
  323.  
  324. inDesk                            EQU        0
  325. inNoWindow                        EQU        0
  326. inMenuBar                        EQU        1
  327. inSysWindow                        EQU        2
  328. inContent                        EQU        3
  329. inDrag                            EQU        4
  330. inGrow                            EQU        5
  331. inGoAway                        EQU        6
  332. inZoomIn                        EQU        7
  333. inZoomOut                        EQU        8
  334. inCollapseBox                    EQU        11
  335.  
  336. inProxyIcon                        EQU        12
  337. ; ——————————————————————————————————————————————————————————————————————————————————————
  338. ;  • Window Definition Hit Test Result Codes                                            
  339. ; ——————————————————————————————————————————————————————————————————————————————————————
  340.  
  341. wNoHit                            EQU        0
  342. wInContent                        EQU        1
  343. wInDrag                            EQU        2
  344. wInGrow                            EQU        3
  345. wInGoAway                        EQU        4
  346. wInZoomIn                        EQU        5
  347. wInZoomOut                        EQU        6
  348. wInCollapseBox                    EQU        9
  349.  
  350. wInProxyIcon                    EQU        10
  351. ; ——————————————————————————————————————————————————————————————————————————————————————
  352. ;  • Window Definition Messages                                                            
  353. ; ——————————————————————————————————————————————————————————————————————————————————————
  354.  
  355.  
  356. kWindowMsgDraw                    EQU        0
  357. kWindowMsgHitTest                EQU        1
  358. kWindowMsgCalculateShape        EQU        2
  359. kWindowMsgInitialize            EQU        3
  360. kWindowMsgCleanUp                EQU        4
  361. kWindowMsgDrawGrowOutline        EQU        5
  362. kWindowMsgDrawGrowBox            EQU        6
  363. kWindowMsgGetFeatures            EQU        7
  364. kWindowMsgGetRegion                EQU        8
  365.  
  366. kWindowMsgDragHilite            EQU        9                    ; parameter boolean indicating on or off
  367. kWindowMsgModified                EQU        10                    ; parameter boolean indicating saved (false) or modified (true)
  368. kWindowMsgDrawInCurrentPort        EQU        11                    ; same as kWindowMsgDraw, but must draw in current port
  369. kWindowMsgSetupProxyDragImage    EQU        12                    ; parameter pointer to SetupWindowProxyDragImageRec
  370. kWindowMsgStateChanged            EQU        13                    ; something about the window's state has changed
  371. kWindowMsgMeasureTitle            EQU        14                    ; measure and return the ideal title width
  372. ;  old names
  373.  
  374. wDraw                            EQU        0
  375. wHit                            EQU        1
  376. wCalcRgns                        EQU        2
  377. wNew                            EQU        3
  378. wDispose                        EQU        4
  379. wGrow                            EQU        5
  380. wDrawGIcon                        EQU        6
  381. ; ——————————————————————————————————————————————————————————————————————————————————————
  382. ;  • State-changed Flags for kWindowMsgStateChanged                                        
  383. ; ——————————————————————————————————————————————————————————————————————————————————————
  384.  
  385. kWindowStateTitleChanged        EQU        $01
  386. kWindowStateSizeChanged            EQU        $02
  387. kWindowStatePositionChanged        EQU        $04
  388. kWindowStateZOrderChanged        EQU        $08
  389. kWindowStateVisibilityChanged    EQU        $10
  390. kWindowStateHiliteChanged        EQU        $20
  391. kWindowStateCollapseChanged        EQU        $40
  392. ; ——————————————————————————————————————————————————————————————————————————————————————
  393. ;  • Window Feature Bits                                                                
  394. ; ——————————————————————————————————————————————————————————————————————————————————————
  395.  
  396. kWindowCanGrow                    EQU        $01
  397. kWindowCanZoom                    EQU        $02
  398. kWindowCanCollapse                EQU        $04
  399. kWindowIsModal                    EQU        $08
  400. kWindowCanGetWindowRegion        EQU        $10
  401. kWindowIsAlert                    EQU        $20
  402. kWindowHasTitleBar                EQU        $40
  403.  
  404. kWindowSupportsDragHilite        EQU        $80                    ; window definition supports kWindowMsgDragHilite
  405. kWindowSupportsModifiedBit        EQU        $0100                ; window definition supports kWindowMsgModified
  406. kWindowCanDrawInCurrentPort        EQU        $0200                ; window definition supports kWindowMsgDrawInCurrentPort
  407. kWindowCanSetupProxyDragImage    EQU        $0400                ; window definition supports kWindowMsgSetupProxyDragImage
  408. kWindowCanMeasureTitle            EQU        $0800                ; window definition supports kWindowMsgMeasureTitle
  409. kWindowWantsDisposeAtProcessDeath EQU    $1000                ; window definition wants a Dispose message for windows still extant during ExitToShell
  410. ; ——————————————————————————————————————————————————————————————————————————————————————
  411. ;  • Desktop Pattern Resource ID                                                        
  412. ; ——————————————————————————————————————————————————————————————————————————————————————
  413.  
  414. deskPatID                        EQU        16
  415.  
  416.  
  417. ; ——————————————————————————————————————————————————————————————————————————————————————
  418. ;  • Window Color Part Codes                                                            
  419. ; ——————————————————————————————————————————————————————————————————————————————————————
  420.  
  421. wContentColor                    EQU        0
  422. wFrameColor                        EQU        1
  423. wTextColor                        EQU        2
  424. wHiliteColor                    EQU        3
  425. wTitleBarColor                    EQU        4
  426.  
  427. ; ——————————————————————————————————————————————————————————————————————————————————————
  428. ;     • Region Dragging Constants                                                            
  429. ; ——————————————————————————————————————————————————————————————————————————————————————
  430.  
  431.  
  432. kMouseUpOutOfSlop                EQU        $80008000
  433.  
  434. ; ——————————————————————————————————————————————————————————————————————————————————————
  435. ;  • Window Color Table                                                                    
  436. ; ——————————————————————————————————————————————————————————————————————————————————————
  437. WinCTab                    RECORD 0
  438. wCSeed                     ds.l    1                ; offset: $0 (0)        ;  reserved 
  439. wCReserved                 ds.w    1                ; offset: $4 (4)        ;  reserved 
  440. ctSize                     ds.w    1                ; offset: $6 (6)        ;  usually 4 for windows 
  441. ctTable                     ds.b    5 * ColorSpec.sizeof ; offset: $8 (8)
  442. sizeof                     EQU *                    ; size:   $30 (48)
  443.                         ENDR
  444. ; typedef struct WinCTab *                WCTabPtr
  445.  
  446. ; typedef WCTabPtr *                    WCTabHandle
  447.  
  448. ; ——————————————————————————————————————————————————————————————————————————————————————
  449. ;  • WindowRecord                                                                        
  450. ; ——————————————————————————————————————————————————————————————————————————————————————
  451.  
  452.  
  453. ; typedef WindowRecord *                WindowPeek
  454.  
  455. WindowRecord            RECORD 0
  456. port                     ds        GrafPort        ; offset: $0 (0)
  457. windowKind                 ds.w    1                ; offset: $6C (108)
  458. visible                     ds.b    1                ; offset: $6E (110)
  459. hilited                     ds.b    1                ; offset: $6F (111)
  460. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  461. spareFlag                 ds.b    1                ; offset: $71 (113)
  462. strucRgn                 ds.l    1                ; offset: $72 (114)
  463. contRgn                     ds.l    1                ; offset: $76 (118)
  464. updateRgn                 ds.l    1                ; offset: $7A (122)
  465. windowDefProc             ds.l    1                ; offset: $7E (126)
  466. dataHandle                 ds.l    1                ; offset: $82 (130)
  467. titleHandle                 ds.l    1                ; offset: $86 (134)
  468. titleWidth                 ds.w    1                ; offset: $8A (138)
  469. controlList                 ds.l    1                ; offset: $8C (140)
  470. nextWindow                 ds.l    1                ; offset: $90 (144)
  471. windowPic                 ds.l    1                ; offset: $94 (148)
  472. refCon                     ds.l    1                ; offset: $98 (152)
  473. sizeof                     EQU *                    ; size:   $9C (156)
  474.                         ENDR
  475. ; ——————————————————————————————————————————————————————————————————————————————————————
  476. ;  • Color WindowRecord                                                                    
  477. ; ——————————————————————————————————————————————————————————————————————————————————————
  478.  
  479.  
  480. ; typedef CWindowRecord *                CWindowPeek
  481.  
  482. CWindowRecord            RECORD 0
  483. port                     ds        CGrafPort        ; offset: $0 (0)
  484. windowKind                 ds.w    1                ; offset: $6C (108)
  485. visible                     ds.b    1                ; offset: $6E (110)
  486. hilited                     ds.b    1                ; offset: $6F (111)
  487. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  488. spareFlag                 ds.b    1                ; offset: $71 (113)
  489. strucRgn                 ds.l    1                ; offset: $72 (114)
  490. contRgn                     ds.l    1                ; offset: $76 (118)
  491. updateRgn                 ds.l    1                ; offset: $7A (122)
  492. windowDefProc             ds.l    1                ; offset: $7E (126)
  493. dataHandle                 ds.l    1                ; offset: $82 (130)
  494. titleHandle                 ds.l    1                ; offset: $86 (134)
  495. titleWidth                 ds.w    1                ; offset: $8A (138)
  496. controlList                 ds.l    1                ; offset: $8C (140)
  497. nextWindow                 ds.l    1                ; offset: $90 (144)
  498. windowPic                 ds.l    1                ; offset: $94 (148)
  499. refCon                     ds.l    1                ; offset: $98 (152)
  500. sizeof                     EQU *                    ; size:   $9C (156)
  501.                         ENDR
  502. ; ——————————————————————————————————————————————————————————————————————————————————————
  503. ;  • AuxWinHandle                                                                        
  504. ; ——————————————————————————————————————————————————————————————————————————————————————
  505.  
  506.  
  507. ; typedef AuxWinRec *                    AuxWinPtr
  508.  
  509. ; typedef AuxWinPtr *                    AuxWinHandle
  510.  
  511. AuxWinRec                RECORD 0
  512. awNext                     ds.l    1                ; offset: $0 (0)        ; handle to next AuxWinRec
  513. awOwner                     ds.l    1                ; offset: $4 (4)        ; ptr to window 
  514. awCTable                 ds.l    1                ; offset: $8 (8)        ; color table for this window
  515. reserved                 ds.l    1                ; offset: $C (12)
  516. awFlags                     ds.l    1                ; offset: $10 (16)        ; reserved for expansion
  517. awReserved                 ds.l    1                ; offset: $14 (20)        ; reserved for expansion
  518. awRefCon                 ds.l    1                ; offset: $18 (24)        ; user Constant
  519. sizeof                     EQU *                    ; size:   $1C (28)
  520.                         ENDR
  521. ; ——————————————————————————————————————————————————————————————————————————————————————
  522. ;     • BasicWindowDescription                                                            
  523. ;                                                                                         
  524. ;     Contains statically-sized basic attributes of the window, for storage in a            
  525. ;     collection item.                                                                    
  526. ; ——————————————————————————————————————————————————————————————————————————————————————
  527. ;  constants for the version field
  528.  
  529. kWindowDefinitionVersionOne        EQU        1
  530. kWindowDefinitionVersionTwo        EQU        2
  531. ;  constants for the stateflags bit field 
  532.  
  533. kWindowIsCollapsedState            EQU        $01
  534. BasicWindowDescription    RECORD 0
  535. descriptionSize             ds.l    1                ; offset: $0 (0)        ;  sizeof(BasicWindowDescription)
  536. windowContentRect         ds        Rect            ; offset: $4 (4)        ;  location on screen
  537. windowZoomRect             ds        Rect            ; offset: $C (12)        ;  location on screen when zoomed out
  538. windowRefCon             ds.l    1                ; offset: $14 (20)        ;  the refcon - __avoid saving stale pointers here__    
  539. windowStateFlags         ds.l    1                ; offset: $18 (24)        ;  flags indicating status of transient window state
  540. windowPositionMethod     ds.l    1                ; offset: $1C (28)        ;  method last used by RepositionWindow to position the window (if any)
  541. windowDefinitionVersion     ds.l    1                ; offset: $20 (32)
  542. windowDefProc             ds.w    1                ; offset: $24 (36)        ;  defProc and variant
  543. windowHasCloseBox         ds.b    1                ; offset: $26 (38)
  544.                          ORG 36
  545. windowClass                 ds.l    1                ; offset: $24 (36)        ;  the class
  546. windowAttributes         ds.l    1                ; offset: $28 (40)        ;  the attributes
  547. sizeof                     EQU *                    ; size:   $2C (44)
  548.                         ENDR
  549. ;   the window manager stores the default collection items using these IDs
  550.  
  551. kStoredWindowSystemTag            EQU        'appl'                ; Only Apple collection items will be of this tag
  552. kStoredBasicWindowDescriptionID    EQU        'sbas'                ; BasicWindowDescription
  553. kStoredWindowPascalTitleID        EQU        's255'                ; pascal title string
  554. kStoredWindowUnicodeTitleID        EQU        'ustr'                ; Unicode title string
  555. ; ——————————————————————————————————————————————————————————————————————————————————————
  556. ;  • Window Class Ordering                                                                
  557. ;                                                                                         
  558. ;     Special cases for the “behind” parameter in window creation calls.                    
  559. ; ——————————————————————————————————————————————————————————————————————————————————————
  560.  
  561. kFirstWindowOfClass                EQU        -1
  562. kLastWindowOfClass                EQU        0
  563. ; ——————————————————————————————————————————————————————————————————————————————————————
  564. ;  • Zoom Information Handle                                                             
  565. ; ——————————————————————————————————————————————————————————————————————————————————————
  566. WStateData                RECORD 0
  567. userState                 ds        Rect            ; offset: $0 (0)        ; user zoom state
  568. stdState                 ds        Rect            ; offset: $8 (8)        ; standard zoom state
  569. sizeof                     EQU *                    ; size:   $10 (16)
  570.                         ENDR
  571. ; typedef struct WStateData *            WStateDataPtr
  572.  
  573. ; typedef WStateDataPtr *                WStateDataHandle
  574.  
  575. ; ——————————————————————————————————————————————————————————————————————————————————————
  576. ;  • Window Creation & Persistence                                                        
  577. ; ——————————————————————————————————————————————————————————————————————————————————————
  578.  
  579. ;
  580. ; pascal OSStatus CreateNewWindow(WindowClass windowClass, WindowAttributes attributes, const Rect *bounds, WindowPtr *outWindow)
  581. ;
  582.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  583.         IMPORT_CFM_FUNCTION CreateNewWindow
  584.     ENDIF
  585.  
  586. ;  Create a window from a ‘wind’ resource
  587. ;
  588. ; pascal OSStatus CreateWindowFromResource(SInt16 resID, WindowPtr *outWindow)
  589. ;
  590.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  591.         IMPORT_CFM_FUNCTION CreateWindowFromResource
  592.     ENDIF
  593.  
  594. ;  window persistence
  595. ;
  596. ; pascal OSStatus StoreWindowIntoCollection(WindowPtr window, Collection collection)
  597. ;
  598.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  599.         IMPORT_CFM_FUNCTION StoreWindowIntoCollection
  600.     ENDIF
  601.  
  602. ;
  603. ; pascal OSStatus CreateWindowFromCollection(Collection collection, WindowPtr *outWindow)
  604. ;
  605.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  606.         IMPORT_CFM_FUNCTION CreateWindowFromCollection
  607.     ENDIF
  608.  
  609. ;  window refcounting
  610. ;
  611. ; pascal OSStatus GetWindowOwnerCount(WindowPtr window, UInt32 *outCount)
  612. ;
  613.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  614.         IMPORT_CFM_FUNCTION GetWindowOwnerCount
  615.     ENDIF
  616.  
  617.  
  618. ;   CloneWindow increments the window’s refcount.  DisposeWindow decrements the refcount, and
  619. ;   disposes only when the refcount reaches zero.  All windows begin life with a refcount of one.
  620. ;   CloseWindow _does not_ pay attention to the refcount, and should therefore be considered
  621. ;   deprecated.
  622.  
  623.  
  624. ;
  625. ; pascal OSStatus CloneWindow(WindowPtr window)
  626. ;
  627.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  628.         IMPORT_CFM_FUNCTION CloneWindow
  629.     ENDIF
  630.  
  631. ;
  632. ; pascal WindowPtr GetNewCWindow(short windowID, void *wStorage, WindowPtr behind)
  633. ;
  634.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  635.         _GetNewCWindow:    OPWORD    $AA46
  636.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  637.         IMPORT_CFM_FUNCTION GetNewCWindow
  638.     ENDIF
  639.  
  640. ;
  641. ; pascal WindowPtr NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon)
  642. ;
  643.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  644.         _NewWindow:    OPWORD    $A913
  645.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  646.         IMPORT_CFM_FUNCTION NewWindow
  647.     ENDIF
  648.  
  649. ;
  650. ; pascal WindowPtr GetNewWindow(short windowID, void *wStorage, WindowPtr behind)
  651. ;
  652.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  653.         _GetNewWindow:    OPWORD    $A9BD
  654.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  655.         IMPORT_CFM_FUNCTION GetNewWindow
  656.     ENDIF
  657.  
  658. ;
  659. ; pascal WindowPtr NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon)
  660. ;
  661.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  662.         _NewCWindow:    OPWORD    $AA45
  663.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION NewCWindow
  665.     ENDIF
  666.  
  667. ;
  668. ; pascal void DisposeWindow(WindowPtr window)
  669. ;
  670.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  671.         _DisposeWindow:    OPWORD    $A914
  672.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  673.         IMPORT_CFM_FUNCTION DisposeWindow
  674.     ENDIF
  675.  
  676. ;
  677. ; pascal void CloseWindow(WindowPtr window)
  678. ;
  679.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  680.         _CloseWindow:    OPWORD    $A92D
  681.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  682.         IMPORT_CFM_FUNCTION CloseWindow
  683.     ENDIF
  684.  
  685.  
  686.  
  687. ; ——————————————————————————————————————————————————————————————————————————————————————
  688. ;  • Window Class Accessors                                                                
  689. ; ——————————————————————————————————————————————————————————————————————————————————————
  690. ;
  691. ; pascal OSStatus GetWindowClass(WindowPtr window, WindowClass *outClass)
  692. ;
  693.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  694.         IMPORT_CFM_FUNCTION GetWindowClass
  695.     ENDIF
  696.  
  697. ;
  698. ; pascal OSStatus GetWindowAttributes(WindowPtr window, WindowAttributes *outAttributes)
  699. ;
  700.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  701.         IMPORT_CFM_FUNCTION GetWindowAttributes
  702.     ENDIF
  703.  
  704.  
  705. ; ——————————————————————————————————————————————————————————————————————————————————————
  706. ;  • Floating Windows                                                                    
  707. ; ——————————————————————————————————————————————————————————————————————————————————————
  708. ;
  709. ; pascal OSStatus ShowFloatingWindows(void)
  710. ;
  711.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  712.         IMPORT_CFM_FUNCTION ShowFloatingWindows
  713.     ENDIF
  714.  
  715. ;
  716. ; pascal OSStatus HideFloatingWindows(void)
  717. ;
  718.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  719.         IMPORT_CFM_FUNCTION HideFloatingWindows
  720.     ENDIF
  721.  
  722. ;
  723. ; pascal Boolean AreFloatingWindowsVisible(void)
  724. ;
  725.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  726.         IMPORT_CFM_FUNCTION AreFloatingWindowsVisible
  727.     ENDIF
  728.  
  729. ;
  730. ; pascal WindowPtr FrontNonFloatingWindow(void)
  731. ;
  732.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  733.         IMPORT_CFM_FUNCTION FrontNonFloatingWindow
  734.     ENDIF
  735.  
  736.  
  737. ; ——————————————————————————————————————————————————————————————————————————————————————
  738. ;  • Background Imaging                                                                    
  739. ; ——————————————————————————————————————————————————————————————————————————————————————
  740. ;
  741. ; pascal OSStatus SetWindowContentColor(WindowPtr window, RGBColor *color)
  742. ;
  743.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  744.         IMPORT_CFM_FUNCTION SetWindowContentColor
  745.     ENDIF
  746.  
  747. ;
  748. ; pascal OSStatus GetWindowContentColor(WindowPtr window, RGBColor *color)
  749. ;
  750.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  751.         IMPORT_CFM_FUNCTION GetWindowContentColor
  752.     ENDIF
  753.  
  754. ;
  755. ; pascal OSStatus GetWindowContentPattern(WindowPtr window, PixPatHandle outPixPat)
  756. ;
  757.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  758.         IMPORT_CFM_FUNCTION GetWindowContentPattern
  759.     ENDIF
  760.  
  761. ;
  762. ; pascal OSStatus SetWindowContentPattern(WindowPtr window, PixPatHandle pixPat)
  763. ;
  764.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  765.         IMPORT_CFM_FUNCTION SetWindowContentPattern
  766.     ENDIF
  767.  
  768. ;
  769. ; pascal void SetWinColor(WindowPtr window, WCTabHandle newColorTable)
  770. ;
  771.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  772.         _SetWinColor:    OPWORD    $AA41
  773.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  774.         IMPORT_CFM_FUNCTION SetWinColor
  775.     ENDIF
  776.  
  777. ;
  778. ; pascal void SetDeskCPat(PixPatHandle deskPixPat)
  779. ;
  780.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  781.         _SetDeskCPat:    OPWORD    $AA47
  782.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  783.         IMPORT_CFM_FUNCTION SetDeskCPat
  784.     ENDIF
  785.  
  786.  
  787.  
  788. ; ——————————————————————————————————————————————————————————————————————————————————————
  789. ;  • Low-Level Region & Painting Routines                                                
  790. ; ——————————————————————————————————————————————————————————————————————————————————————
  791. ;
  792. ; pascal void ClipAbove(WindowPtr window)
  793. ;
  794.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  795.         _ClipAbove:    OPWORD    $A90B
  796.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  797.         IMPORT_CFM_FUNCTION ClipAbove
  798.     ENDIF
  799.  
  800. ;
  801. ; pascal void SaveOld(WindowPtr window)
  802. ;
  803.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  804.         _SaveOld:    OPWORD    $A90E
  805.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  806.         IMPORT_CFM_FUNCTION SaveOld
  807.     ENDIF
  808.  
  809. ;
  810. ; pascal void DrawNew(WindowPtr window, Boolean update)
  811. ;
  812.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  813.         _DrawNew:    OPWORD    $A90F
  814.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  815.         IMPORT_CFM_FUNCTION DrawNew
  816.     ENDIF
  817.  
  818. ;
  819. ; pascal void PaintOne(WindowPtr window, RgnHandle clobberedRgn)
  820. ;
  821.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  822.         _PaintOne:    OPWORD    $A90C
  823.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  824.         IMPORT_CFM_FUNCTION PaintOne
  825.     ENDIF
  826.  
  827. ;
  828. ; pascal void PaintBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  829. ;
  830.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  831.         _PaintBehind:    OPWORD    $A90D
  832.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  833.         IMPORT_CFM_FUNCTION PaintBehind
  834.     ENDIF
  835.  
  836. ;
  837. ; pascal void CalcVis(WindowPtr window)
  838. ;
  839.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  840.         _CalcVis:    OPWORD    $A909
  841.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  842.         IMPORT_CFM_FUNCTION CalcVis
  843.     ENDIF
  844.  
  845. ;
  846. ; pascal void CalcVisBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  847. ;
  848.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  849.         _CalcVisBehind:    OPWORD    $A90A
  850.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  851.         IMPORT_CFM_FUNCTION CalcVisBehind
  852.     ENDIF
  853.  
  854. ;
  855. ; pascal Boolean CheckUpdate(EventRecord *theEvent)
  856. ;
  857.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  858.         _CheckUpdate:    OPWORD    $A911
  859.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  860.         IMPORT_CFM_FUNCTION CheckUpdate
  861.     ENDIF
  862.  
  863. ; ——————————————————————————————————————————————————————————————————————————————————————
  864. ;  • Window List                                                                        
  865. ; ——————————————————————————————————————————————————————————————————————————————————————
  866. ;
  867. ; pascal short FindWindow(Point thePoint, WindowPtr *window)
  868. ;
  869.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  870.         _FindWindow:    OPWORD    $A92C
  871.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  872.         IMPORT_CFM_FUNCTION FindWindow
  873.     ENDIF
  874.  
  875. ;
  876. ; pascal WindowPtr FrontWindow(void )
  877. ;
  878.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  879.         _FrontWindow:    OPWORD    $A924
  880.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  881.         IMPORT_CFM_FUNCTION FrontWindow
  882.     ENDIF
  883.  
  884. ;
  885. ; pascal void BringToFront(WindowPtr window)
  886. ;
  887.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  888.         _BringToFront:    OPWORD    $A920
  889.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  890.         IMPORT_CFM_FUNCTION BringToFront
  891.     ENDIF
  892.  
  893. ;
  894. ; pascal void SendBehind(WindowPtr window, WindowPtr behindWindow)
  895. ;
  896.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  897.         _SendBehind:    OPWORD    $A921
  898.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  899.         IMPORT_CFM_FUNCTION SendBehind
  900.     ENDIF
  901.  
  902. ;
  903. ; pascal void SelectWindow(WindowPtr window)
  904. ;
  905.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  906.         _SelectWindow:    OPWORD    $A91F
  907.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  908.         IMPORT_CFM_FUNCTION SelectWindow
  909.     ENDIF
  910.  
  911.  
  912. ; ——————————————————————————————————————————————————————————————————————————————————————
  913. ;  • Misc Low-Level stuff                                                                            
  914. ; ——————————————————————————————————————————————————————————————————————————————————————
  915. ;
  916. ; pascal Boolean IsValidWindowPtr(GrafPtr grafPort)
  917. ;
  918.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  919.         IMPORT_CFM_FUNCTION IsValidWindowPtr
  920.     ENDIF
  921.  
  922. ;  call either InitFloatingWindows or InitWindows, not both
  923. ;
  924. ; pascal OSStatus InitFloatingWindows(void)
  925. ;
  926.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  927.         IMPORT_CFM_FUNCTION InitFloatingWindows
  928.     ENDIF
  929.  
  930. ;
  931. ; pascal void InitWindows(void )
  932. ;
  933.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  934.         _InitWindows:    OPWORD    $A912
  935.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  936.         IMPORT_CFM_FUNCTION InitWindows
  937.     ENDIF
  938.  
  939. ;
  940. ; pascal void GetWMgrPort(GrafPtr *wPort)
  941. ;
  942.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  943.         _GetWMgrPort:    OPWORD    $A910
  944.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  945.         IMPORT_CFM_FUNCTION GetWMgrPort
  946.     ENDIF
  947.  
  948. ;
  949. ; pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  950. ;
  951.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  952.         _GetCWMgrPort:    OPWORD    $AA48
  953.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  954.         IMPORT_CFM_FUNCTION GetCWMgrPort
  955.     ENDIF
  956.  
  957.  
  958.  
  959. ; ——————————————————————————————————————————————————————————————————————————————————————
  960. ;  • Various & Sundry Window Accessors                                                            
  961. ; ——————————————————————————————————————————————————————————————————————————————————————
  962. ;
  963. ; pascal void HiliteWindow(WindowPtr window, Boolean fHilite)
  964. ;
  965.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  966.         _HiliteWindow:    OPWORD    $A91C
  967.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  968.         IMPORT_CFM_FUNCTION HiliteWindow
  969.     ENDIF
  970.  
  971. ;  GetWindowFeatures & GetWindowRegion are available with Appearance 1.0 and later
  972. ;
  973. ; pascal OSStatus GetWindowFeatures(WindowPtr window, UInt32 *outFeatures)
  974. ;
  975.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  976.         Macro
  977.         _GetWindowFeatures
  978.             move.w              #$0013,D0
  979.             dc.w                $AA74
  980.         EndM
  981.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  982.         IMPORT_CFM_FUNCTION GetWindowFeatures
  983.     ENDIF
  984.  
  985. ;
  986. ; pascal OSStatus GetWindowRegion(WindowPtr window, WindowRegionCode inRegionCode, RgnHandle ioWinRgn)
  987. ;
  988.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  989.         Macro
  990.         _GetWindowRegion
  991.             move.w              #$0014,D0
  992.             dc.w                $AA74
  993.         EndM
  994.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  995.         IMPORT_CFM_FUNCTION GetWindowRegion
  996.     ENDIF
  997.  
  998. ;
  999. ; pascal void SetWRefCon(WindowPtr window, long data)
  1000. ;
  1001.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1002.         _SetWRefCon:    OPWORD    $A918
  1003.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1004.         IMPORT_CFM_FUNCTION SetWRefCon
  1005.     ENDIF
  1006.  
  1007. ;
  1008. ; pascal long GetWRefCon(WindowPtr window)
  1009. ;
  1010.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1011.         _GetWRefCon:    OPWORD    $A917
  1012.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1013.         IMPORT_CFM_FUNCTION GetWRefCon
  1014.     ENDIF
  1015.  
  1016. ;
  1017. ; pascal void SetWindowPic(WindowPtr window, PicHandle pic)
  1018. ;
  1019.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1020.         _SetWindowPic:    OPWORD    $A92E
  1021.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1022.         IMPORT_CFM_FUNCTION SetWindowPic
  1023.     ENDIF
  1024.  
  1025. ;
  1026. ; pascal PicHandle GetWindowPic(WindowPtr window)
  1027. ;
  1028.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1029.         _GetWindowPic:    OPWORD    $A92F
  1030.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1031.         IMPORT_CFM_FUNCTION GetWindowPic
  1032.     ENDIF
  1033.  
  1034. ;
  1035. ; pascal short GetWVariant(WindowPtr window)
  1036. ;
  1037.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1038.         _GetWVariant:    OPWORD    $A80A
  1039.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1040.         IMPORT_CFM_FUNCTION GetWVariant
  1041.     ENDIF
  1042.  
  1043. ; ——————————————————————————————————————————————————————————————————————————————————————
  1044. ;  • Update Events                                                                        
  1045. ; ——————————————————————————————————————————————————————————————————————————————————————
  1046. ;
  1047. ; pascal OSStatus InvalWindowRgn(WindowPtr window, RgnHandle region)
  1048. ;
  1049.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1050.         IMPORT_CFM_FUNCTION InvalWindowRgn
  1051.     ENDIF
  1052.  
  1053. ;
  1054. ; pascal OSStatus InvalWindowRect(WindowPtr window, const Rect *bounds)
  1055. ;
  1056.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1057.         IMPORT_CFM_FUNCTION InvalWindowRect
  1058.     ENDIF
  1059.  
  1060. ;
  1061. ; pascal OSStatus ValidWindowRgn(WindowPtr window, RgnHandle region)
  1062. ;
  1063.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1064.         IMPORT_CFM_FUNCTION ValidWindowRgn
  1065.     ENDIF
  1066.  
  1067. ;
  1068. ; pascal OSStatus ValidWindowRect(WindowPtr window, const Rect *bounds)
  1069. ;
  1070.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1071.         IMPORT_CFM_FUNCTION ValidWindowRect
  1072.     ENDIF
  1073.  
  1074. ;
  1075. ; pascal void InvalRect(const Rect *badRect)
  1076. ;
  1077.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1078.         _InvalRect:    OPWORD    $A928
  1079.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1080.         IMPORT_CFM_FUNCTION InvalRect
  1081.     ENDIF
  1082.  
  1083. ;
  1084. ; pascal void InvalRgn(RgnHandle badRgn)
  1085. ;
  1086.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1087.         _InvalRgn:    OPWORD    $A927
  1088.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1089.         IMPORT_CFM_FUNCTION InvalRgn
  1090.     ENDIF
  1091.  
  1092. ;
  1093. ; pascal void ValidRect(const Rect *goodRect)
  1094. ;
  1095.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1096.         _ValidRect:    OPWORD    $A92A
  1097.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1098.         IMPORT_CFM_FUNCTION ValidRect
  1099.     ENDIF
  1100.  
  1101. ;
  1102. ; pascal void ValidRgn(RgnHandle goodRgn)
  1103. ;
  1104.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1105.         _ValidRgn:    OPWORD    $A929
  1106.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1107.         IMPORT_CFM_FUNCTION ValidRgn
  1108.     ENDIF
  1109.  
  1110. ;
  1111. ; pascal void BeginUpdate(WindowPtr window)
  1112. ;
  1113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1114.         _BeginUpdate:    OPWORD    $A922
  1115.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1116.         IMPORT_CFM_FUNCTION BeginUpdate
  1117.     ENDIF
  1118.  
  1119. ;
  1120. ; pascal void EndUpdate(WindowPtr window)
  1121. ;
  1122.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1123.         _EndUpdate:    OPWORD    $A923
  1124.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1125.         IMPORT_CFM_FUNCTION EndUpdate
  1126.     ENDIF
  1127.  
  1128.  
  1129. ; ——————————————————————————————————————————————————————————————————————————————————————
  1130. ;  • DrawGrowIcon                                                                        
  1131. ;                                                                                         
  1132. ;     With the advent of Appearance, DrawGrowIcon is obsolete.  Beginning with Appearance    
  1133. ;     1.0    the system WDEF automagically draws the grow icon for growable window            
  1134. ;     procIDs.                                                                            
  1135. ; ——————————————————————————————————————————————————————————————————————————————————————
  1136. ;
  1137. ; pascal void DrawGrowIcon(WindowPtr window)
  1138. ;
  1139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1140.         _DrawGrowIcon:    OPWORD    $A904
  1141.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1142.         IMPORT_CFM_FUNCTION DrawGrowIcon
  1143.     ENDIF
  1144.  
  1145.  
  1146. ; ——————————————————————————————————————————————————————————————————————————————————————
  1147. ;  • Window Titles & Document Support                                                    
  1148. ; ——————————————————————————————————————————————————————————————————————————————————————
  1149. ;
  1150. ; pascal void SetWTitle(WindowPtr window, ConstStr255Param title)
  1151. ;
  1152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1153.         _SetWTitle:    OPWORD    $A91A
  1154.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1155.         IMPORT_CFM_FUNCTION SetWTitle
  1156.     ENDIF
  1157.  
  1158. ;
  1159. ; pascal void GetWTitle(WindowPtr window, Str255 title)
  1160. ;
  1161.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1162.         _GetWTitle:    OPWORD    $A919
  1163.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1164.         IMPORT_CFM_FUNCTION GetWTitle
  1165.     ENDIF
  1166.  
  1167.  
  1168. ;
  1169. ; pascal OSStatus SetWindowProxyFSSpec(WindowPtr window, const FSSpec *inFile)
  1170. ;
  1171.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1172.         IMPORT_CFM_FUNCTION SetWindowProxyFSSpec
  1173.     ENDIF
  1174.  
  1175. ;
  1176. ; pascal OSStatus GetWindowProxyFSSpec(WindowPtr window, FSSpec *outFile)
  1177. ;
  1178.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1179.         IMPORT_CFM_FUNCTION GetWindowProxyFSSpec
  1180.     ENDIF
  1181.  
  1182. ;
  1183. ; pascal OSStatus SetWindowProxyAlias(WindowPtr window, AliasHandle alias)
  1184. ;
  1185.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1186.         IMPORT_CFM_FUNCTION SetWindowProxyAlias
  1187.     ENDIF
  1188.  
  1189. ;
  1190. ; pascal OSStatus GetWindowProxyAlias(WindowPtr window, AliasHandle *alias)
  1191. ;
  1192.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1193.         IMPORT_CFM_FUNCTION GetWindowProxyAlias
  1194.     ENDIF
  1195.  
  1196. ;
  1197. ; pascal OSStatus SetWindowProxyCreatorAndType(WindowPtr window, OSType fileCreator, OSType fileType, SInt16 vRefNum)
  1198. ;
  1199.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1200.         IMPORT_CFM_FUNCTION SetWindowProxyCreatorAndType
  1201.     ENDIF
  1202.  
  1203. ;
  1204. ; pascal OSStatus GetWindowProxyIcon(WindowPtr window, IconRef *outIcon)
  1205. ;
  1206.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1207.         IMPORT_CFM_FUNCTION GetWindowProxyIcon
  1208.     ENDIF
  1209.  
  1210. ;
  1211. ; pascal OSStatus SetWindowProxyIcon(WindowPtr window, IconRef icon)
  1212. ;
  1213.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1214.         IMPORT_CFM_FUNCTION SetWindowProxyIcon
  1215.     ENDIF
  1216.  
  1217. ;
  1218. ; pascal OSStatus RemoveWindowProxy(WindowPtr window)
  1219. ;
  1220.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1221.         IMPORT_CFM_FUNCTION RemoveWindowProxy
  1222.     ENDIF
  1223.  
  1224. ;
  1225. ; pascal OSStatus BeginWindowProxyDrag(WindowPtr window, DragReference *outNewDrag, RgnHandle outDragOutlineRgn)
  1226. ;
  1227.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1228.         IMPORT_CFM_FUNCTION BeginWindowProxyDrag
  1229.     ENDIF
  1230.  
  1231. ;
  1232. ; pascal OSStatus EndWindowProxyDrag(WindowPtr window, DragReference theDrag)
  1233. ;
  1234.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1235.         IMPORT_CFM_FUNCTION EndWindowProxyDrag
  1236.     ENDIF
  1237.  
  1238. ;
  1239. ; pascal OSStatus TrackWindowProxyFromExistingDrag(WindowPtr window, Point startPt, DragReference drag, RgnHandle inDragOutlineRgn)
  1240. ;
  1241.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1242.         IMPORT_CFM_FUNCTION TrackWindowProxyFromExistingDrag
  1243.     ENDIF
  1244.  
  1245. ;
  1246. ; pascal OSStatus TrackWindowProxyDrag(WindowPtr window, Point startPt)
  1247. ;
  1248.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1249.         IMPORT_CFM_FUNCTION TrackWindowProxyDrag
  1250.     ENDIF
  1251.  
  1252.  
  1253. ;  window document dirty bit
  1254.  
  1255. ;
  1256. ; pascal Boolean IsWindowModified(WindowPtr window)
  1257. ;
  1258.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1259.         IMPORT_CFM_FUNCTION IsWindowModified
  1260.     ENDIF
  1261.  
  1262. ;
  1263. ; pascal OSStatus SetWindowModified(WindowPtr window, Boolean modified)
  1264. ;
  1265.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1266.         IMPORT_CFM_FUNCTION SetWindowModified
  1267.     ENDIF
  1268.  
  1269. ;  file path stuff
  1270.  
  1271. ;
  1272. ; pascal Boolean IsWindowPathSelectClick(WindowPtr window, EventRecord *event)
  1273. ;
  1274.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1275.         IMPORT_CFM_FUNCTION IsWindowPathSelectClick
  1276.     ENDIF
  1277.  
  1278.  
  1279. ;   The Window Manager will provide default menus and AppleEvent-posting behavior for file
  1280. ;   proxies if you pass NULL for menu.  On output, outMenuItem contains a MenuSelect-style
  1281. ;   return value, id and item in a single 32-bit word.  WindowPathSelect will temporarily
  1282. ;   insert the menu into the menu list.
  1283.  
  1284.  
  1285. ;
  1286. ; pascal OSStatus WindowPathSelect(WindowPtr window, MenuHandle menu, SInt32 *outMenuResult)
  1287. ;
  1288.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1289.         IMPORT_CFM_FUNCTION WindowPathSelect
  1290.     ENDIF
  1291.  
  1292.  
  1293. ; ——————————————————————————————————————————————————————————————————————————————————————
  1294. ;     • HiliteWindowFrameForDrag                                                            
  1295. ;                                                                                         
  1296. ;     If you call ShowDragHilite and HideDragHilite, you don’t need to use this procedure.
  1297. ;     If you implement custom drag hiliting, you must call HiliteWindowFrameForDrag when    
  1298. ;     the drag is tracking inside    a window with drag-hilited content.                        
  1299. ; ——————————————————————————————————————————————————————————————————————————————————————
  1300. ;
  1301. ; pascal OSStatus HiliteWindowFrameForDrag(WindowPtr window, Boolean hilited)
  1302. ;
  1303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1304.         Macro
  1305.         _HiliteWindowFrameForDrag
  1306.             moveq               #25,D0
  1307.             dc.w                $A829
  1308.         EndM
  1309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1310.         IMPORT_CFM_FUNCTION HiliteWindowFrameForDrag
  1311.     ENDIF
  1312.  
  1313.  
  1314. ; ——————————————————————————————————————————————————————————————————————————————————————
  1315. ;  • Window Transitions                                                                    
  1316. ;                                                                                          
  1317. ;      TransitionWindow allows you to display a window using animation and sound.            
  1318. ; ——————————————————————————————————————————————————————————————————————————————————————
  1319. ; typedef UInt32                         WindowTransitionEffect
  1320.  
  1321.  
  1322. kWindowZoomTransitionEffect        EQU        1                    ; Finder-like zoom rectangles, use with Show or Open transition actions
  1323. ; typedef UInt32                         WindowTransitionAction
  1324.  
  1325.  
  1326. kWindowShowTransitionAction        EQU        1                    ; param is rect in global coordinates from which to start the animation
  1327. kWindowHideTransitionAction        EQU        2                    ; param is rect in global coordinates at which to end the animation
  1328. ;
  1329. ; pascal OSStatus TransitionWindow(WindowPtr window, WindowTransitionEffect effect, WindowTransitionAction action, const Rect *rect)
  1330. ;
  1331.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1332.         IMPORT_CFM_FUNCTION TransitionWindow
  1333.     ENDIF
  1334.  
  1335. ; ——————————————————————————————————————————————————————————————————————————————————————
  1336. ;  • Window Positioning                                                                    
  1337. ; ——————————————————————————————————————————————————————————————————————————————————————
  1338. ;
  1339. ; pascal OSStatus RepositionWindow(WindowPtr window, WindowPtr parentWindow, WindowPositionMethod method)
  1340. ;
  1341.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1342.         IMPORT_CFM_FUNCTION RepositionWindow
  1343.     ENDIF
  1344.  
  1345. ;  manipulate the size of the window, using coordiantes pinned to the specified region (content or structure)
  1346. ;
  1347. ; pascal OSStatus SetWindowBounds(WindowPtr window, WindowRegionCode regionCode, const Rect *globalBounds)
  1348. ;
  1349.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1350.         IMPORT_CFM_FUNCTION SetWindowBounds
  1351.     ENDIF
  1352.  
  1353. ;
  1354. ; pascal OSStatus GetWindowBounds(WindowPtr window, WindowRegionCode regionCode, Rect *globalBounds)
  1355. ;
  1356.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1357.         IMPORT_CFM_FUNCTION GetWindowBounds
  1358.     ENDIF
  1359.  
  1360. ;  move the window, pinned to the structure region rather than, as in MoveWindow, the content region
  1361. ;
  1362. ; pascal OSStatus MoveWindowStructure(WindowPtr window, short hGlobal, short vGlobal)
  1363. ;
  1364.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1365.         IMPORT_CFM_FUNCTION MoveWindowStructure
  1366.     ENDIF
  1367.  
  1368. ;  GrowWindow and SizeWindow in one groovy call
  1369. ;
  1370. ; pascal Boolean ResizeWindow(WindowPtr window, Point startPoint, const Rect *sizeConstraints, Rect *newContentRect)
  1371. ;
  1372.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1373.         IMPORT_CFM_FUNCTION ResizeWindow
  1374.     ENDIF
  1375.  
  1376. ;
  1377. ; pascal Boolean IsWindowCollapsable(WindowPtr window)
  1378. ;
  1379.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1380.         Macro
  1381.         _IsWindowCollapsable
  1382.             move.w              #$000F,D0
  1383.             dc.w                $AA74
  1384.         EndM
  1385.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1386.         IMPORT_CFM_FUNCTION IsWindowCollapsable
  1387.     ENDIF
  1388.  
  1389. ;
  1390. ; pascal Boolean IsWindowCollapsed(WindowPtr window)
  1391. ;
  1392.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1393.         Macro
  1394.         _IsWindowCollapsed
  1395.             move.w              #$0010,D0
  1396.             dc.w                $AA74
  1397.         EndM
  1398.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1399.         IMPORT_CFM_FUNCTION IsWindowCollapsed
  1400.     ENDIF
  1401.  
  1402. ;
  1403. ; pascal OSStatus CollapseWindow(WindowPtr window, Boolean collapse)
  1404. ;
  1405.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1406.         Macro
  1407.         _CollapseWindow
  1408.             move.w              #$0011,D0
  1409.             dc.w                $AA74
  1410.         EndM
  1411.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1412.         IMPORT_CFM_FUNCTION CollapseWindow
  1413.     ENDIF
  1414.  
  1415. ;
  1416. ; pascal OSStatus CollapseAllWindows(Boolean collapse)
  1417. ;
  1418.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1419.         Macro
  1420.         _CollapseAllWindows
  1421.             move.w              #$0012,D0
  1422.             dc.w                $AA74
  1423.         EndM
  1424.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1425.         IMPORT_CFM_FUNCTION CollapseAllWindows
  1426.     ENDIF
  1427.  
  1428. ;
  1429. ; pascal void MoveWindow(WindowPtr window, short hGlobal, short vGlobal, Boolean front)
  1430. ;
  1431.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1432.         _MoveWindow:    OPWORD    $A91B
  1433.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1434.         IMPORT_CFM_FUNCTION MoveWindow
  1435.     ENDIF
  1436.  
  1437. ;
  1438. ; pascal void SizeWindow(WindowPtr window, short w, short h, Boolean fUpdate)
  1439. ;
  1440.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1441.         _SizeWindow:    OPWORD    $A91D
  1442.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1443.         IMPORT_CFM_FUNCTION SizeWindow
  1444.     ENDIF
  1445.  
  1446.  
  1447. ;
  1448. ; pascal void ZoomWindow(WindowPtr window, short partCode, Boolean front)
  1449. ;
  1450.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1451.         _ZoomWindow:    OPWORD    $A83A
  1452.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1453.         IMPORT_CFM_FUNCTION ZoomWindow
  1454.     ENDIF
  1455.  
  1456. ;
  1457. ; pascal Boolean IsWindowInStandardState(WindowPtr window, Point *idealSize, Rect *idealStandardState)
  1458. ;
  1459.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1460.         IMPORT_CFM_FUNCTION IsWindowInStandardState
  1461.     ENDIF
  1462.  
  1463. ;  Zoomin’!  All apps should use ZoomWindowIdeal in place of ZoomWindow.
  1464. ;
  1465. ; pascal OSStatus ZoomWindowIdeal(WindowPtr window, SInt16 partCode, Point *ioIdealSize)
  1466. ;
  1467.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1468.         IMPORT_CFM_FUNCTION ZoomWindowIdeal
  1469.     ENDIF
  1470.  
  1471. ;
  1472. ; pascal OSStatus GetWindowIdealUserState(WindowPtr window, Rect *userState)
  1473. ;
  1474.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1475.         IMPORT_CFM_FUNCTION GetWindowIdealUserState
  1476.     ENDIF
  1477.  
  1478. ;
  1479. ; pascal OSStatus SetWindowIdealUserState(WindowPtr window, Rect *userState)
  1480. ;
  1481.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1482.         IMPORT_CFM_FUNCTION SetWindowIdealUserState
  1483.     ENDIF
  1484.  
  1485. ;
  1486. ; pascal long GrowWindow(WindowPtr window, Point startPt, const Rect *bBox)
  1487. ;
  1488.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1489.         _GrowWindow:    OPWORD    $A92B
  1490.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1491.         IMPORT_CFM_FUNCTION GrowWindow
  1492.     ENDIF
  1493.  
  1494. ;
  1495. ; pascal void DragWindow(WindowPtr window, Point startPt, const Rect *boundsRect)
  1496. ;
  1497.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1498.         _DragWindow:    OPWORD    $A925
  1499.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1500.         IMPORT_CFM_FUNCTION DragWindow
  1501.     ENDIF
  1502.  
  1503.  
  1504. ; ——————————————————————————————————————————————————————————————————————————————————————
  1505. ;  • Window Visibility                                                                    
  1506. ; ——————————————————————————————————————————————————————————————————————————————————————
  1507.  
  1508. ;
  1509. ; pascal void HideWindow(WindowPtr window)
  1510. ;
  1511.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1512.         _HideWindow:    OPWORD    $A916
  1513.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1514.         IMPORT_CFM_FUNCTION HideWindow
  1515.     ENDIF
  1516.  
  1517. ;
  1518. ; pascal void ShowWindow(WindowPtr window)
  1519. ;
  1520.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1521.         _ShowWindow:    OPWORD    $A915
  1522.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1523.         IMPORT_CFM_FUNCTION ShowWindow
  1524.     ENDIF
  1525.  
  1526. ;
  1527. ; pascal void ShowHide(WindowPtr window, Boolean showFlag)
  1528. ;
  1529.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1530.         _ShowHide:    OPWORD    $A908
  1531.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1532.         IMPORT_CFM_FUNCTION ShowHide
  1533.     ENDIF
  1534.  
  1535.  
  1536. ; ——————————————————————————————————————————————————————————————————————————————————————
  1537. ;  • Window Properties                                                                            
  1538. ; ——————————————————————————————————————————————————————————————————————————————————————
  1539.  
  1540. ;
  1541. ; pascal OSStatus GetWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag, UInt32 bufferSize, UInt32 *actualSize, void *propertyBuffer)
  1542. ;
  1543.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1544.         IMPORT_CFM_FUNCTION GetWindowProperty
  1545.     ENDIF
  1546.  
  1547. ;
  1548. ; pascal OSStatus GetWindowPropertySize(WindowPtr window, PropertyCreator creator, PropertyTag tag, UInt32 *size)
  1549. ;
  1550.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1551.         IMPORT_CFM_FUNCTION GetWindowPropertySize
  1552.     ENDIF
  1553.  
  1554. ;
  1555. ; pascal OSStatus SetWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag, UInt32 propertySize, void *propertyBuffer)
  1556. ;
  1557.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1558.         IMPORT_CFM_FUNCTION SetWindowProperty
  1559.     ENDIF
  1560.  
  1561. ;
  1562. ; pascal OSStatus RemoveWindowProperty(WindowPtr window, PropertyCreator propertyCreator, PropertyTag propertyTag)
  1563. ;
  1564.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1565.         IMPORT_CFM_FUNCTION RemoveWindowProperty
  1566.     ENDIF
  1567.  
  1568. ; ——————————————————————————————————————————————————————————————————————————————————————
  1569. ;  • Utilities                                                                            
  1570. ; ——————————————————————————————————————————————————————————————————————————————————————
  1571. ;
  1572. ; pascal long PinRect(const Rect *theRect, Point thePt)
  1573. ;
  1574.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1575.         _PinRect:    OPWORD    $A94E
  1576.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1577.         IMPORT_CFM_FUNCTION PinRect
  1578.     ENDIF
  1579.  
  1580.  
  1581. ;
  1582. ; pascal RgnHandle GetGrayRgn(void)
  1583. ;
  1584.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1585.         Macro
  1586.         _GetGrayRgn           &dest=(sp)
  1587.             move.l            $09EE,&dest
  1588.         EndM
  1589.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1590.         IMPORT_CFM_FUNCTION GetGrayRgn
  1591.     ENDIF
  1592.  
  1593.  
  1594. ; ——————————————————————————————————————————————————————————————————————————————————————
  1595. ;  • Window Part Tracking                                                                
  1596. ; ——————————————————————————————————————————————————————————————————————————————————————
  1597. ;
  1598. ; pascal Boolean TrackBox(WindowPtr window, Point thePt, short partCode)
  1599. ;
  1600.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1601.         _TrackBox:    OPWORD    $A83B
  1602.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1603.         IMPORT_CFM_FUNCTION TrackBox
  1604.     ENDIF
  1605.  
  1606. ;
  1607. ; pascal Boolean TrackGoAway(WindowPtr window, Point thePt)
  1608. ;
  1609.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1610.         _TrackGoAway:    OPWORD    $A91E
  1611.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1612.         IMPORT_CFM_FUNCTION TrackGoAway
  1613.     ENDIF
  1614.  
  1615.  
  1616. ; ——————————————————————————————————————————————————————————————————————————————————————
  1617. ;  • Region Dragging                                                                    
  1618. ; ——————————————————————————————————————————————————————————————————————————————————————
  1619. ;
  1620. ; pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  1621. ;
  1622.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1623.         _DragGrayRgn:    OPWORD    $A905
  1624.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1625.         IMPORT_CFM_FUNCTION DragGrayRgn
  1626.     ENDIF
  1627.  
  1628. ;
  1629. ; pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  1630. ;
  1631.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1632.         _DragTheRgn:    OPWORD    $A926
  1633.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1634.         IMPORT_CFM_FUNCTION DragTheRgn
  1635.     ENDIF
  1636.  
  1637.  
  1638. ; ——————————————————————————————————————————————————————————————————————————————————————
  1639. ;     • GetAuxWin                                                                            
  1640. ;                                                                                         
  1641. ;     Avoid using GetAuxWin if at all possible                                            
  1642. ; ——————————————————————————————————————————————————————————————————————————————————————
  1643. ;
  1644. ; pascal Boolean GetAuxWin(WindowPtr window, AuxWinHandle *awHndl)
  1645. ;
  1646.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1647.         _GetAuxWin:    OPWORD    $AA42
  1648.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1649.         IMPORT_CFM_FUNCTION GetAuxWin
  1650.     ENDIF
  1651.  
  1652.  
  1653. ; ——————————————————————————————————————————————————————————————————————————————————————
  1654. ;  • MixedMode & ProcPtrs                                                                
  1655. ; ——————————————————————————————————————————————————————————————————————————————————————
  1656. ; ——————————————————————————————————————————————————————————————————————————————————————
  1657. ;  • C Glue                                                                                
  1658. ; ——————————————————————————————————————————————————————————————————————————————————————
  1659. ; ——————————————————————————————————————————————————————————————————————————————————————
  1660. ;  • WindowRecord accessor macros                                                        
  1661. ; ——————————————————————————————————————————————————————————————————————————————————————
  1662. ;    *****************************************************************************
  1663. ;    *                                                                           *
  1664. ;    * The conditional STRICT_WINDOWS has been removed from this interface file. *
  1665. ;    * The accessor macros to a WindowRecord are no longer necessary.            *
  1666. ;    *                                                                           *
  1667. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  1668. ;    *                                                                           *
  1669. ;    *****************************************************************************
  1670. ;
  1671. ;    Details:
  1672. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  1673. ;    help ease the transition to Copland.  Shared data structures are difficult
  1674. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  1675. ;    WindowRecord and other data structures, we would begin the migration to the
  1676. ;    discipline wherein system data structures are completely hidden from
  1677. ;    applications.
  1678. ;    
  1679. ;    After many design reviews, we finally concluded that with this sort of
  1680. ;    migration, the system could never tell when an application was no longer
  1681. ;    peeking at a WindowRecord, and thus the data structure might never become
  1682. ;    system owned.  Additionally, there were many other limitations in the
  1683. ;    classic toolbox that were begging to be addressed.  The final decision was
  1684. ;    to leave the traditional toolbox as a compatibility mode.
  1685. ;    
  1686. ;    We also decided to use the Handle and Ptr based types in the function
  1687. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  1688. ;    WindowRef.  The Ref types are still defined in the header files, so all
  1689. ;    existing code will still compile exactly as it did before.  There are
  1690. ;    several reasons why we chose to do this:
  1691. ;    
  1692. ;    - The importance of backwards compatibility makes it unfeasible for us to
  1693. ;    enforce real opaque references in the implementation anytime in the
  1694. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  1695. ;    ControlRef, etc.) in the documentation and header files would always be a
  1696. ;    fake veneer of opacity.
  1697. ;    
  1698. ;    - There exists a significant base of books and sample code that neophyte
  1699. ;    Macintosh developers use to learn how to program the Macintosh.  These
  1700. ;    books and sample code all use direct data access.  Introducing opaque data
  1701. ;    types at this point would confuse neophyte programmers more than it would
  1702. ;    help them.
  1703. ;    
  1704. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  1705. ;    Changing the interfaces to reflect a false opacity would not provide any
  1706. ;    benefit to these developers.
  1707. ;    
  1708. ;    - Accessor functions are useful in and of themselves as convenience
  1709. ;    functions.
  1710. ;    
  1711. ;    - Note: some accessor names conflict with API's in Win32 and have been renamed
  1712. ;    to have a Mac prefix (QuickTime 3.0).
  1713. ;
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.     ENDIF ; __MACWINDOWS__ 
  1723.  
  1724.